package com.project.controller.manager;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.OrderBean;
import com.project.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RequestMapping("manager")
@RestController
public class ManagerController {
    @Autowired
    private IOrderService orderService;

    @RequestMapping("findByItem")
    public IPage<OrderBean> findByItem(int pageNO, String status, LocalDate startDate, LocalDate endDate){
        System.out.println("---------------------------------------------");
        return orderService.findByItem(pageNO,status,startDate,endDate);
    }

    @RequestMapping("findById")
    public OrderBean findById(int orderId){
        return orderService.findById(orderId);
    }
}
